<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>我的</title>

    <!-- bootstrap -->
    <link rel="stylesheet" href="./assets/css/bootstrap.min.css" />

    <!-- animate.css -->
    <link rel="stylesheet" href="./assets/css/animate.min.css" />

    <!-- MUI -->
    <link rel="stylesheet" href="./assets/plugins/mui/css/mui.min.css">

    <!-- 重置样式 -->
    <link rel="stylesheet" href="./assets/css/reset.css" />

    <!-- 公共样式 -->
    <link rel="stylesheet" href="./assets/css/common.css" />

    <!-- 页面独立的 -->
    <link rel="stylesheet" href="./assets/css/UserIndex.css" />
</head>

<body>
    <!-- 用户信息 -->
    <div class="user">
        <div class="avatar wow fadeInUp">
            <img src="./assets/images/avatar.png"  style="width: 100%; height: 100%;object-fit: cover;"/>
        </div>

        <div class="nickname wow fadeInUp" data-wow-delay="100ms">FunkyRicky</div>
    </div>

    <!-- 菜单 -->
    <div class="menulist wow fadeInUp" data-wow-delay="300ms">
        <a href="profile.html" class="item">
            <span>基本资料</span>
            <img src='./assets/images/row.png' />
        </a>
        <a href="typeIndex.html" class="item">
            <span>卡片分类</span>
            <img src='./assets/images/row.png' />
        </a>
        <a href="javascript:void(0)" class="item" id="logout">
            <span>退出登陆</span>
            <img src='./assets/images/row.png' />
        </a>
    </div>


    <!-- 底部 -->
    <div class="tabbar">
        <div class="box">
            <a href="index.html" class="item">
                <span class="icon glyphicon glyphicon-home"></span>
                <span class="name">首页</span>
            </a>
            <a href="ContactAdd.html" class="item">
                <span class="icon glyphicon glyphicon-list-alt"></span>
                <span class="name">新建</span>
            </a>
            <a href="my.html" class="item">
                <span class="icon glyphicon glyphicon-user"></span>
                <span class="name">我的</span>
            </a>
        </div>
    </div>
</body>

</html>
<!-- jquery  -->
<script src="./assets/js/jquery.min.js"></script>

<!-- bootstrap -->
<script src="./assets/js/bootstrap.min.js"></script>

<!-- wow.js -->
<script src="./assets/js/wow.min.js"></script>

<!-- MUI -->
<script src="./assets/plugins/mui/js/mui.min.js"></script>

<!-- axios请求 -->
<script src="./assets/plugins/axios/axios.js"></script>
<script src="./assets/plugins/axios/request.js"></script>

<!-- cookie -->
<script src="./assets/plugins/cookie.js"></script>

<!-- 校验用户是否登陆 -->
<script src="./assets/plugins/helper.js"></script>

<script>
    //实例化wow.js
    new WOW().init();

    let Business = cookie.get('Business') ? JSON.parse(cookie.get('Business')) : "{}";
    console.log(Business)

    if (Business) {
        $(".avatar img").attr('src', Business.avatar)
        $(".nickname").text(Business.nickname)
    }

    $("#logout").click(() => {
        mui.confirm('确认退出登陆?', '退出', ['确定', '取消'], function (e) {
            if (e.index == 0) {
                cookie.clear();
                mui.toast('退出成功');
                setTimeout(() => {
                    location.href = 'login.html'
                }, 1000)
            }
        })
    })
</script>